<style lang="scss" scoped>
.dashboard {
  position: absolute;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 1920px;
  height: 1080px;
  // background: url("../assets/img/logo.png") top no-repeat;
  // 修改最上面lop图片
  background: url("../assets/img/newlogo.png") top no-repeat;
  background-size: contain;
  & > div {
    position: absolute;
    // border: solid 1px rgba(255, 255, 255, 0.2);
  }
}

.title {
  top: 50px;
  left: 30px;
  font-size: 40px;
  color: white;
}

.bg-title {
  position: absolute;
  // top: 48px;
  top: 34px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 464px;
  height: 26px;
  font-size: 35px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  color: #fff;
}

@keyframes shan {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.Warning-lang {
  left: 632px;
  top: 95px;
  width: 655px;
  height: 17px;
  font-size: 22px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  color: #ff0048;
  line-height: 30px;
  animation: shan 0.8s infinite linear alternate-reverse;
}

.doughnut {
  top: 107px;
  // left: 26px;
  left: 32px;
  width: 450px;
  height: 198px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.point {
  top: 356px;
  // left: 26px;
  left: 32px;
  width: 450px;
  height: 324px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.line {
  // left: 26px;
  left: 32px;
  // bottom: 34px;
  bottom: 8px;
  width: 450px;
  height: 314px;
}
.title-box {
  left: 501px;
  width: 911px;
  margin-top: 130px;
  height: 58px;
  display: flex;
}
.title-center {
  display: flex;
  position: relative;
  // background-color: #fff;
  flex: 1;
  // margin: 3px 3px;
  // justify-content: space-between;
  font-size: 20px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  text-align: center;
  // color: #48eaff;
  color: #fff;
  // text-align: center;
  margin: 0 4px;
}
.title-center .ly-tz {
  flex: 1;
  text-align: center;
  line-height: -58px;
  // background-color: #fff;
}

.panel-hight {
  a {
    color: #48eaff;
  }
  position: relative;
  border: 6px solid transparent;
  border-width: 14px;
  border-image-source: url("../assets/img/title-hight.png");
  border-image-slice: 16;
}

.map {
  left: 495px;
  top: 235px;
  width: 913px;
  height: 513px;
  // background-color: #fff;
  // background-color: #ccc;
}
.pop {
  left: 495px;
  top: 235px;
  width: 913px;
  height: 513px;
  // background-color: #fff;
}
.dianzi {
  position: absolute;
  top: 357px;
  left: 743px;
  width: 418px;
  height: 269px;
  // background-color: #fff;
}

.bar {
  left: 506px;
  bottom: 8px;
  width: 911px;
  height: 254px;
  display: flex;
  justify-content: center;
}
.bar-left {
  position: relative;
  width: 86px;
  justify-content: space-between;
  display: flex;
  flex-direction: column;
  .bj-img {
    width: 86px;
    height: 99px;
    background: url("../assets/img/huo.png") no-repeat;
    background-size: 86px auto;
    margin-top: 47px;
  }

  .bar-top {
    position: absolute;
    top: 148px;
    left: 14px;
    font-size: 24px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
  .bar-bottom {
    position: absolute;
    top: 178px;
    left: 14px;
    font-size: 16px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
}
.bar-center {
  position: relative;
  width: 86px;

  justify-content: space-between;
  display: flex;
  flex-direction: column;
  margin: 0 169px;
  .bj-img {
    width: 86px;
    height: 99px;
    background: url("../assets/img/zhuji.png") no-repeat;
    background-size: 86px auto;
    margin-top: 47px;
  }

  .bar-top {
    position: absolute;
    top: 148px;
    left: 14px;
    font-size: 24px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
  .bar-bottom {
    position: absolute;
    top: 178px;
    left: 14px;
    font-size: 16px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
}
.bar-right {
  position: relative;
  width: 86px;
  // background-color: pink;
  justify-content: space-between;
  display: flex;
  flex-direction: column;

  // margin: 0 169px;
  .bj-img {
    width: 86px;
    height: 99px;
    background: url("../assets/img/shui.png") no-repeat;
    background-size: 86px auto;
    margin-top: 47px;
  }

  .bar-top {
    position: absolute;
    top: 148px;
    left: 16px;
    font-size: 24px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
  .bar-bottom {
    position: absolute;
    top: 178px;
    left: 16px;
    font-size: 16px;
    color: #48eaff;
    font-family: YouSheBiaoTiHei;
  }
}

.pie-char {
  right: 27px;
  top: 107px;
  width: 450px;
  // height: 654px;
  height: 644px;
  // border: solid 1px rgba(255, 255, 255, 0.2);

  // 添加视频背景色
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;

  span {
    color: #48eaff;
    margin-top: -20px;

    font-size: 18px;
  }
  .span-mesg {
    margin-left: -60px;
  }
  .span-title {
    // margin-left: -20px;

    font-size: 18px;
    font-family: YouSheBiaoTiHei;
  }
  .span-title1 {
    color: red;
  }
}
// .vido {
//   height: 240px;
//   border: 1px solid #fff;
//   width: 100%;
//   // background-color: #0c4582;
// }
video {
  height: 240px;
  width: 100%;
}

// .gauge {
//   top: 356px;
//   right: 27px;
//   width: 450px;
//   // height: 324px;
//   height: 313px;
//   // border: solid 1px rgba(255, 255, 255, 0.2);
// }

.double-line {
  right: 27px;
  // bottom: 34px;
  bottom: 8px;
  width: 450px;
  // height: 314px;
  height: 254px;
}

// .fullscreen-button {
//   top: 20px;
//   width: 200px;
//   height: 40px;
//   font-size: 25px;
//   color: white;
//   right: 30px;
//   border-radius: 8px;
//   color: #e9d70c;
// }

// 火焰盒子
.flame {
  position: absolute;
  top: 576px;
  left: 990px;
  width: 45px;
  height: 57px;
  // background-color: #fff;
  // background-image: url("../assets/img/flame.png");
  background: url("../assets/img/flame.png") no-repeat center;
  animation: shan 0.8s infinite linear alternate-reverse;
}
// 红色人形按钮
.redbtn {
  position: absolute;
  top: 516px;
  left: 718px;
  width: 47px;
  height: 47px;
  background: url("../assets/img/redbtn.png") no-repeat center;
  // background-color: #fff;
}
.btnt {
  position: absolute;
  top: -6px;
  right: 0;
  width: 25px;
  height: 25px;
  background: url("../assets/img/btn-t.png") center;
}
</style>
<template>
  <div class="dashboard">
    <div class="bg-title">星云智慧园</div>
    <!-- <div class="title">Dashboard</div> -->
    <!-- <div class='fullscreen-button' @click='toggleFullscreen'>toggle fullscreen</div> -->
    <div class="Warning-lang" v-show="isTitle">
      办公楼3楼杂物间消防报警，疑似着火，请消防应急人员立即处理
    </div>
    <div class="doughnut panel1">
      <div class="public ">安保统计</div>
      <!-- <doughnut></doughnut> -->
      <zgl></zgl>
    </div>
    <div class="point panel1">
      <div class="public ">告警状态统计</div>
      <!-- <point></point> -->
      <gjzs></gjzs>
    </div>
    <div class="line panel1">
      <div class="public ">本月巡检统计</div>
      <!-- <line-chart></line-chart> -->
      <xctj></xctj>
    </div>
    <div class="line-y-ca"></div>
    <div class="title-box">
      <div
        class="panel-title title-center"
        :class="activeClass == index ? 'panel-hight' : ''"
        v-for="(item, index) in itemList"
        :key="index"
        @click="getItem(index)"
      >
        <router-link :to="item.link" class="ly-tz">{{ item.name }}</router-link>
      </div>
    </div>
    <div class="map" v-show="isMap">
      <!-- <Map></Map> -->
      <Conduct></Conduct>
      <Tab></Tab>
    </div>
    <div class="pop" v-show="isPop">
      <Center @pp="parrr"></Center>
      <cvdeo></cvdeo>
    </div>
    <!-- 电子围栏显示 -->
    <div class="dianzi" v-show="isDianzi">
      <Dian ref="child" @pf="parent"></Dian>
    </div>
    <!-- 增加的火焰效果盒子 -->
    <div
      class="flame"
      v-show="isShow == 1 ? true : false"
      @click="MapShow"
    ></div>
    <!-- 红色人字形按钮 -->
    <div class="redbtn" v-show="isRedbtn" @click="Pop"></div>
    <div class="bar panel1">
      <div class="public ">消防设备报警</div>
      <!-- <bar></bar> -->
      <div class="bar-left">
        <span class="bj-img" @click="flame"></span>
        <span class="bar-top">4/15</span>
        <span class="bar-bottom">火警异常</span>
      </div>
      <div class="bar-center">
        <span class="bj-img"></span>
        <span class="bar-top">2/18</span>
        <span class="bar-bottom">主机异常</span>
      </div>
      <div class="bar-right">
        <span class="bj-img"></span>
        <span class="bar-top">1/10</span>
        <span class="bar-bottom">水源异常</span>
      </div>
    </div>
    <div class="pie-char panel1">
      <div class="public ">视频监控</div>
      <!-- <pie></pie> -->
      <!-- <div class="vido"> -->
      <video autoplay="autoplay" controls="controls" loop="loop" muted="true">
        <source src="../assets/video/疑似黑名单.mp4" type="video/mp4" />
        你的浏览器不支持视频播放
      </video>
      <!-- </div> -->
      <span>园区门禁A</span>
      <span class="span-mesg">2021.01.15 10:30</span>
      <span class="span-title" v-show="!spantitle">(疑似黑名单)</span>
      <span class="span-title span-title1" v-show="spantitle"
        >(疑似黑名单)</span
      >

      <!-- <div class="vido"> -->
      <video autoplay="autoplay" controls="controls" loop="loop" muted="true">
        <source src="../assets/video/疑似高烧患者.mp4" type="video/mp4" />
        你的浏览器不支持视频播放
      </video>
      <!-- </div> -->
      <span>园区门禁B</span>
      <span class="span-mesg">2021.01.15 10:30</span>
      <span class="span-title">(疑似高烧患者)</span>
    </div>
    <!-- <div class="gauge panel">
      <div class="public ">工单处理统计</div>
      <gauge></gauge>
    </div> -->
    <div class="double-line panel1">
      <div class="public ">电子围栏告警</div>
      <div class="btnt" @click="ShowTitle"></div>
      <lunbo ref="goodslist"></lunbo>
    </div>
  </div>
</template>

<script>
import Doughnut from "@/components/charts/Doughnut";
import Point from "@/components/charts/Point";
import LineChart from "@/components/charts/Line";
import Map from "@/components/charts/Map";
import Bar from "@/components/charts/Bar";
import Pie from "@/components/charts/Pie";
import Gauge from "@/components/charts/Gauge";
import DoubleLine from "@/components/charts/DoubleLine";
import Lunbo from "@/components/charts/Lunbo";
import Xctj from "@/components/charts/Xctj";
import Gjzs from "@/components/charts/Gjzs";
import Zgl from "@/components/charts/Zgl";
import Tab from "../components/charts/Zhaf/Tab";
import Dian from "../components/charts/Zhaf/Dian";
import Conduct from "../components/charts/Conduct";
import Center from "../components/charts/Center";
import Cvdeo from "../components/charts/Cvdeo";

export default {
  name: "Zhaf",
  components: {
    Doughnut,
    Point,
    Map,
    LineChart,
    Bar,
    Pie,
    Gauge,
    DoubleLine,
    Lunbo,
    Xctj,
    Gjzs,
    Zgl,
    Tab,
    Conduct,
    Dian,
    Center,
    Cvdeo,
  },
  data() {
    return {
      isFullScreen: false,
      activeClass: 1,
      itemList: [
        { name: "园区综合态势", link: "/home" },
        { name: "综合安防", link: "/Zhaf" },
        { name: "资产管理", link: "/Zcgl" },
        { name: "能耗管理", link: "/Nhgl" },
        { name: "环境监测", link: "/Hjjc" },
      ],
      isShow: 0,
      isMap: false,
      isTitle: false,
      isDianzi: false,
      isRedbtn: false,
      spantitle: false,
      isPop: false,
    };
  },
  methods: {
    getItem(index) {
      this.activeClass = index;
    },
    // toggleFullscreen() {
    //   if (this.isFullScreen) {
    //     this.exitFullScreen()
    //   } else {
    //     this.launchFullScreen(document.documentElement)
    //   }
    //   this.isFullScreen = !this.isFullScreen
    // },
    launchFullScreen(element) {
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
      } else if (element.webkitRequestFullscreen) {
        element.webkitRequestFullscreen();
      } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
      }
    },
    exitFullScreen() {
      if (document.exitFullscreen) {
        document.exitFullScreen();
      } else if (document.webkitExitFullscreen) {
        document.webkitExitFullscreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
      }
    },

    // 点击图片显示和隐藏火
    flame() {
      console.log("1");
      this.isShow = !this.isShow;
      this.isTitle = !this.isTitle;
      if (this.isShow == 1) {
        this.isShow = true;
      }
      this.isMap = false;
      this.isPop = false;
    },
    MapShow() {
      console.log("2");
      this.isMap = true;
      this.isShow = 2;
    },
    ShowTitle() {
      this.$refs.child.chuachua();
      console.log("点击盒子按钮");
      this.isDianzi = !this.isDianzi;
    },
    parent() {
      this.$refs.goodslist.start();
      this.spantitle = !this.spantitle;
    },
    parrr() {
      this.$refs.goodslist.end();
      this.spantitle = !this.spantitle;
    },

    // 显示人形按钮
    ishowrenbtn() {
      this.isRedbtn = !this.isRedbtn;
    },
    // 点击人形按钮
    Pop() {
      this.isPop = !this.isPop;
      this.isRedbtn = !this.isRedbtn;
    },
    ishid() {
      this.isPop = false;
    },
    ishidmap() {
      this.isMap = !this.isMap;
      this.flame();
    },
  },
};
</script>
